<!-- 智能问诊，症状列表 -->
<template>
	<view class="inquiry-list-wrapper">
		<u--input placeholder="输入您要搜索的疾病或症状" prefixIcon="search" prefixIconStyle="font-size: 22px;color: #909399"
			v-model="keyword" @confirm="search"></u--input>
		<div style="margin-bottom: 5px;"></div>

		<view class="list-container" >
			<view class="symptom-item" @click="goToDetail(item.id)" v-for="(item, index) in dataList" :key="index">
				{{item.title}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				keyword: '',
				dataList: []
			}
		},
		onLoad(option) {
			this.api_hot_tank()
		},
		methods: {
			goToDetail(id) {
				uni.navigateTo({
					url: '/pagesB/intelligentInquiry/symptomDetail?id=' + id
				})
			},

			search(val) {
				this.api_hot_tank()
			},

			api_hot_tank() {
				this.$app._get('entry/wxapp/answer.hot_tank', {
					keyword: this.keyword,
					page: 0,
					pagesize: 100
				}, (result) => {
					console.log(result)
					this.dataList = result
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.inquiry-list-wrapper {
		width: 100%;
		height: 100%;
		background-color: #fff;
		padding: 20px;
		box-sizing: border-box;

		.list-container {

			.symptom-item {
				display: flex;
				align-items: center;
				justify-items: center;
				padding: 20px;
				background-color: #e0e0e0;
				border-radius: 6px;
				margin-bottom: 5px;
			}
		}
	}
</style>